import request from '@/utils/request'
/**
 *
 * 员工管理
 *
 **/
// 登录
export const login = (data: any) =>
  request({
    'url': '/employee/login',
    'method': 'post',
    data: data
  })

  // 退出
 export const userLogout = (params: any) =>
 request({
   'url': `/employee/logout`,
   'method': 'post',
   params
 })

// 员工信息分页查询
export const getEmployeeList = (params: any) =>
request({
  'url': `/employee/page`,
  'method': 'get',
  'params': params,
})

// 员工账号启用禁用
export const enableOrDisableEmployee = (params: any) =>
  request({
    'url': `/employee/status/${params.status}`,
    'method': 'post',
    'params': {id:params.id},
  })

// 新增员工
export const addEmployee = (params: any) =>
  request({
    'url': '/employee',
    'method': 'post',
    'data': params,
})

// 通过员工id查询员工信息
export const queryEmployeeById = (id :number) =>
  request({
    'url': `/employee/${id}`,
    'method': 'get',
})

// 修改员工信息
export const updateEmployee = (params:any) =>
  request({
    'url': '/employee/',
    'method': 'put',
    'data' : params,
})